In this example, the Momentary push button controls the state of a valve. The valve can be open, closed, or partially open.
Create a Momentary push button and select the "Normally open" button action. Add the caption "Open" for State 0 and "Closed" for State 1. Assign a tag to the Value connection.
When the operator presses the button, the application sets the button to State 1 and the caption changes to Closed. The data source registers the change to the tag assigned to the Value connection and closes the valve.
When the operator releases the button or the hold time has elapsed, whichever is later, the application sets the button to State 0 and the caption changes to Open. The data source registers the change to the tag assigned to the Value connection and opens the valve.
Create a Momentary push button and select the "Normally closed" button action. Add the caption "Closed" for State 0 and "Open" for State 1.
When the operator presses the button, the application sets the button to State 1 and the caption changes to Open. The data source registers the change to the tag assigned to the Value connection and opens the valve.
When the operator releases the button or the hold time has elapsed, whichever is later, the application sets the button to State 0 and the caption changes to Closed. The data source registers the change to the tag assigned to the Value connection and closes the valve.
Create a Momentary push button and select the Value button action. Change the value for State 0 to 100 and the value for State 1 to 50. Add the caption "Closed" for State 0 and "Open 50%" for State 1.
When the operator presses the button, the application sets the button to State 1 and the caption changes to Open 50%. The data source registers the change to the tag assigned to the Value connection and opens the valve 50%.
When the operator releases the button or the hold time has elapsed, whichever is later, the application sets the button to State 0 and the caption changes to Closed. The data source registers the change to the tag assigned to the Value connection and closes the valve.
Causes of run-time errors for the Momentary push button
About the Momentary push buttons error state
Configure the Momentary push button
Set up states for the Momentary push button